﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity.Infrastructure;
using QuanLyHocPhi.Model;
using System.Data.Entity;

namespace QuanLyHocPhi.BLL
{
    class BizLopHocPhanChuyenNganh_SinhVien
    {
        internal static List<LopHocPhanChuyenNganh_SinhVien> GetListLopHocPhanChuyenNganh(string maSinhVien)
        {
            using (var context = new QLHPEntities())
            {
                var list = from e in context.LopHocPhanChuyenNganh_SinhVienDbSet.Include(t => t.LopHocPhanChuyenNganh)
                           where e.MaSinhVien == maSinhVien
                           select e;
                return list.ToList();
            }
        }
        internal static LopHocPhanChuyenNganh_SinhVien GetLopHPCN_SinhVien(string maSV, string maLopHocPhanCN)
        {
            using (var context = new QLHPEntities())
            {
                return context.LopHocPhanChuyenNganh_SinhVienDbSet.Include(e=>e.LopHocPhanChuyenNganh).SingleOrDefault(e=>e.MaSinhVien == maSV && e.MaLopHocPhanChuyenNganh == maLopHocPhanCN);
            }
        }
    }
}
